<body leftmargin="0" rightmargin="0" topmargin="0">
<!--application header-->
<? include "header.inc.php"; ?>
<!--EOapplication header-->

<!--left menu start-->
<? if ($USE_FRAME_MENU == false) { ?>
<div style="float: left; width:180px; height:100%; margin-right:20px;">
<?
include "menu.php";
?>
</div>
<? } ?>
<!--left menu end-->

<p/>
  <table class="tableMainBodyFont" border="0" cellpadding="2" cellspacing="0" width="750" align="center">
    <tbody>
      <tr>
        <td style="border-top-style: solid; border-top-width: 1px;" align="center" bgcolor="#aaaaaa" width="3%"><strong>Item Group List</strong></td>
      </tr>
    </tbody>
  </table>
<? alert_flash_message(); ?>
<form action="?act=create" id="daftar" method="post" onSubmit="return GoSubmit(this)">
  <br>
  <table width="750" align="center" class="tableMainBodyFont">
    <tr>
      <td align="right"><a href="group.php?act=new" style="color: blue; font-size: 10px;">Add New</a></td>
    </tr>
  </table>
  <table width="750" border="1" align="center" bgcolor="#dddddd" class="tableMainBodyFont" id="qua_table">
    <tr>
      <th width="5%">Bil</th>
      <th width="35%">Name</th>
      <th width="35%">Default Graph</th>
      <th width="15%">&nbsp;</th>
    </tr>
    <?
	$i=0;
	while($dat = pg_fetch_object($res)){
		$id = $dat->id;
		$i++;
    ?>
    <tr align="center" id="<?="row_$i"?>">
      <td align="center"><?=$i+1?></td>
      <td align="left"><a href="#" title="">
        <?=$dat->name?>
      </a></td>
      <td align="left"><?=$dat->graph_type_name?></td>
      <td align="center"><a href="group.php?act=edit&id=<?=$id?>" style="color: blue; font-size: 10px;">Edit</a> | <a href="javascript:goDelete(<?=$id?>)" style="color: blue; font-size: 10px;">Delete</a> </td>
    </tr>
    <?
          }
          ?>
  </table>
  <table width="750" align="center" class="tableMainBodyFont">
    <tr>
      <td align="right">&nbsp;</td>
    </tr>
  </table>
</form>
</body>
<script>
function  goDelete(objid) { 
	//obj = document.getElementById('obj_'+objid+'_name').innerHTML;
	if (confirm('Are you sure')) {
		//alert(objid);
		location = 'group.php?id=' + objid + '&act=destroy' ;
	}
}
</script>	
